﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

using EShop.Core.Model.System;
using EShop.Services.System;
using EShop.Core.Model.Store;
using EShop.Services.Store;

namespace EShop.App.Admin
{
    public class ShopController : AdminPages
    {
        #region Fields
        private readonly IOrderService _IOrderService;
        #endregion

        #region Constructors
        public ShopController(IOrderService iorderService)
        {
            this._IOrderService = iorderService;
        }
        #endregion

        #region method
        public ActionResult OrderList(int? page)
        {
             if (page == null) page = 0;
             var list = _IOrderService.GetAllOrder((int)page, 20, -1);
            return View(list);
        }

        public ActionResult Order_Audit(int id)
        {
            var m = _IOrderService.GetOrderById(id);
            return View(m);
        }

        [HttpPost, ActionName("Order_Audit")]
        public ActionResult OrderPost(Order m)
        {
            return View("Order_Audit");
        }
        #endregion
    }
}
